import { trendsType } from "@/api/biasset.js";

export const tableOption = {
  border: true,
  index: true,
  indexLabel: "序号",
  stripe: true,
  menuAlign: "center",
  align: "center",
  dialogDirection: "rtl",
  searchMenuSpan: 6,
  column: [
    {
      type: "input",
      label: "名称",
      search: true,
      prop: "name",
      rules: [
        {
          required: true,
          message: "请输入名称",
          trigger: "blur",
        },
      ],
    },
    {
      type: "select",
      label: "标签",
      prop: "tag",
      multiple: true,
      span: 12,
      dicUrl: "/asset/biasset/tags",
      width: 150,
      rules: [
        {
          required: true,
          message: "请选择标签",
          trigger: "change",
        },
      ],
    },
    {
      type: "input",
      label: "内容",
      prop: "content",
      component: "avueUeditor",
      slot: true,
      hide: true,
      options: {
        action: "/fastfile/upload/szgk-1256675456",
        props: {
          res: "data", // 解析文件上传后的respose.JSON
          url: "kpath", // 解析responseJSON==> data.fileUrl
        },
      },
      span: 24,
      rules: [
        {
          required: true,
          message: "请输入内容",
          trigger: "blur",
        },
      ],
    },
    {
      type: "datetime",
      label: "开始时间",
      prop: "startTime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      rules: [
        {
          required: true,
          message: "请选择开始时间",
          trigger: "change",
        },
      ],
    },
    {
      type: "input",
      label: "要求",
      prop: "content",
      component: "avueUeditor",
      slot: true,
      hide: true,
      options: {
        action: "/fastfile/upload/szgk-1256675456",
        props: {
          res: "data", // 解析文件上传后的respose.JSON
          url: "kpath", // 解析responseJSON==> data.fileUrl
        },
      },
      span: 24,
    },
    {
      label: "图片集",
      prop: "contentImg",
      type: "upload",
      action: "/fastfile/upload/szgk-1256675456",
      listType: "picture-card",
      dataType: "string",
      propsHttp: {
        res: "data",
        url: "kpath",
      },
      span: 24,
      rules: [
        {
          required: true,
          message: "请选择图片集",
          trigger: "change",
        },
      ],
    },
    {
      type: "map",
      label: "地址",
      prop: "address",
      dataType: "string",
      formatter: (data) => {
        const str = data.address ? data.address.split(",") : "";
        return str[2];
      },
      rules: [
        {
          required: true,
          message: "请选择地址",
          trigger: "change",
        },
      ],
    },
    // {
    //   "type": "input",
    //   "label": "地图坐标x",
    //   "prop": "lat"
    // },	  {
    //   "type": "input",
    //   "label": "地图坐标y",
    //   "prop": "lng"
    // },
    {
      type: "input",
      label: "联系人",
      prop: "contacts",
      rules: [
        {
          required: true,
          message: "请输入联系人",
          trigger: "blur",
        },
      ],
    },
    {
      type: "input",
      label: "联系电话",
      prop: "contactsPhone",
      rules: [
        {
          required: true,
          message: "请输入联系电话",
          trigger: "blur",
        },
      ],
    },

    {
      type: "datetime",
      label: "创建时间",
      prop: "createTime",
      format: "yyyy-MM-dd HH:mm:ss",
      valueFormat: "yyyy-MM-dd HH:mm:ss",
      rules: [
        {
          required: true,
          message: "请选择时间",
          trigger: "blur",
        },
      ],
      display: false,
    },
    {
      type: "input",
      label: "排序号",
      prop: "sort",
      hide: true,
    },
  ],
};
